home *** CD-ROM | disk | FTP | other *** search
- ; CBM installer script to install Imagemaster on users hard-drive
- ; by: Ben Williams
- ; Written: Aug 26/92
- ; Updates: Oct 5/92 - dctv.library added to distribution to read dctv pix
- ; Sep 30/92 - Adds "wipes" dir to RXPI: for transition generator
- ; - Fixes doc & dev installs so they work better
- ; - Removes "takes time req", substitutes CON: windows
- ; Sep 24/92 - Extract now OVER-writes; RE-installs work ok now
- ; Aug 31/92 - Non-prompting assignment checks added
- ;----------------------------------------------------------------
- ;Notes:
- ;------->
- ; (1) We force a minimum level of AVERAGE user so that they
- ; must specify the target directory for the install and
- ; answer some basic questions such as "Do you have an FPU"
- ;
- ; (2) There must be sufficient diskspace to install the software
- ; or we won't even try to install.
- ;
- ; (3) ARexx must be available, or we won't try to install
- ;----------------------------------------------------------------
-
- ; cleanup routine
- ;----------------
- (onerror)
-
- ; Make certain rexx: directory exists - if ARexx isn't running, we
- ; can (sortof) live with that, though the user will be seriously
- ; crippled in capability. If no assignment exists, we're toast
- ;-----------------------------------------------------------------
- (if (= (getassign "rexx") "")
- (abort "Cannot install - no REXX: assignment in this system. "
- "You MUST have ARexx and a drawer assigned to REXX: "
- "to hold ARexx scripts in order to successfully "
- "install Imagemaster. Please properly configure "
- "your computer and try again. If you do not know how "
- "to accomplish this, call your dealer or consultant."
- )
- )
-
- ; Find out where user wants to put Imageaster
- ;----------------------------------------------
- (set user_place
- (askdir
- (prompt "Where shall we place the Imagemaster DRAWER? ")
- (help @askdir-help "It is important that you realize that the destination you specify here "
- "is for the DRAWER in which Imagemaster and it's associated data files "
- "will be placed. Even if this is an update to an earlier installation, "
- "you still need to specify this location the same way. Otherwise, a new "
- "\"Imagemaster\" drawer will be created INSIDE your old one, causing "
- "much confusion and not amusing anyone.")
- (default @default-dest)
- )
- )
-
- ; Check to see if assigns are already made
- ;-----------------------------------------
- (set as_made 0)
- (if (<> (getassign "rxpi:") "")
- (if (<> (getassign "cmpi:") "")
- (set as_made 1)
- )
- )
-
- ; Find out if user wants the developer code
- ;------------------------------------------
- (set dev_install
- (askoptions
- (prompt "Would you like to have the Public Interface developer "
- "C and ARexx code, with documentation? This will allow "
- "you to create public interface modules of your own, if "
- "you own the SAS C compiler and have typical Amiga "
- "developer skills.")
- (help @askoptions-help "If you are NOT a technical type, "
- "you have no need for this data. If you are, then by all "
- "means install it!")
- (choices "Install SAS C and ARexx developer code?")
- (default 0)
- )
- )
-
- ; Check with user if they want the docs on-disk
- ;----------------------------------------------
- (set doc_install
- (askoptions
- (prompt "Would you like to install the additional documents "
- "into the Imagemaster drawer? This is not usually "
- "necessary, because they can be printed by clicking "
- "on the \"print-docs\" icon at any time, if you have "
- "a printer.")
- (help "If you do NOT have a printer, you'll have to read the "
- " documents using a text editor, and you SHOULD install "
- "them to the Imagemaster drawer. "
- @askoptions-help)
- (choices "Install addendum into Imagemaster drawer?")
- (default 0)
- )
- )
-
- ; Check with user if they want the floating point version
- ;--------------------------------------------------------
- (set float_install
- (askchoice
- (prompt "Do you have a floating-point unit (FPU)? ")
- (help "An FPU is a special hardware mathematics processor "
- "which allows a computer which uses it to figure out "
- "answers to math problems using floating point math "
- "much faster than it could without an FPU. A 68000 "
- "Amiga has no FPU. 68020 or 68030 based-Amigas may "
- "have an FPU - check your documentation if you're not "
- "certain. 68040-based Amigas always have the FPU built "
- "right in. The non-FPU version will work on an Amiga "
- "with an FPU, however it will be much slower which "
- "will cost you unecessary time when processing images. "
- @askchoice-help)
- (choices "Install Floating Point (FPU) version"
- "Install standard (NON-FPU) version")
- (default 1)
- )
- )
-
- ; We know where Imagemaster is to be installed now, we'll do some
- ; checking to make sure that we have enough room for the installation.
- ; The IM release is (approximately) sized as follows:
- ;---------------------------------------------
- ; Imagemaster ------------------- 1400000 bytes
- ; FilmView ---------------------- 45000 bytes
- ; IShapes ----------------------- 21000 bytes
- ; Addendum file ----------------- 190000 bytes
- ; Developer stuff --------------- 16000 bytes
- ; Public Interface Modules ------ 1300000 bytes
- ; -------
- ; Total: 2972000 bytes - about 3 megabytes
- ;-----------------------------------------------------------------------
- (set tgt_space (getdiskspace user_place))
- (set total_size 3000000)
- (if (= dev_install 0)
- (set total_size (- total_size "16000"))
- )
- (if (= doc_install 0)
- (set total_size (- total_size "190000"))
- )
-
- ; If we can't do the main install, quit immediately
- ;
- (if (< tgt_space total_size)
- (abort "This installation requires about " ("%ld" total_size)
- " bytes free on the "
- "volume where you wish to install Imagemaster. Please "
- "make this space available and then re-install. For your "
- "information, the volume you have selected has only "
- ("%ld " tgt_space) "bytes free. You need "
- ("%ld " (- total_size tgt_space)) "more bytes.")
- )
-
- ; We'll need our compressed-file extraction command:
- ;---------------------------------------------------
- (set src_disk "IM_Install2:")
- (askdisk
- (prompt "Please insert Imagemaster diskette #2")
- (help "We need to copy some files from this diskette.")
- (dest "IM_Install2")
- )
-
- ; Get the extract command
- ;------------------------
- (copyfiles (source src_disk)
- (dest "ram:")
- (pattern "extract")
- (files)
- )
-
- ; Now we'll get a grip on our installation volume
- ;------------------------------------------------
-
- (set src_one "IM_Install1")
- (set src_two "IM_Install2")
- (set src_three "IM_Install3")
- (set src_four "IM_Install4")
- ; We've got the target; now we need to make sure that we have our main DIR
- ;-------------------------------------------------------------------------
- (
- (set im_dest (tackon user_place "Imagemaster"))
- (if (not (exists im_dest))
- (makedir im_dest (infos))
- )
- (set @default-dest im_dest)
- )
-
- ; Create subordinate target strings
- ;----------------------------------
- (set rxpi_dir (tackon im_dest "rxpi"))
- (set wipe_dir (tackon rxpi_dir "wipes"))
- (set cmpi_dir (tackon im_dest "cmpi"))
- (set ish_dir (tackon im_dest "IShapes"))
- (set dev_dir (tackon im_dest "Developer"))
- (set doc_dir (tackon im_dest "Docs"))
- (set lib_dir "libs:")
- (set rexx_dir "rexx:")
-
- ; Create RXPI drawer if it's not already there
- ;---------------------------------------------
- (if (not (exists rxpi_dir))
- (makedir rxpi_dir (infos))
- )
-
- ; Create wipes drawer if it's not already there
- ;----------------------------------------------
- (if (not (exists wipe_dir))
- (makedir wipe_dir (infos))
- )
-
- ; Create CMPI drawer if it's not already there
- ;---------------------------------------------
- (if (not (exists cmpi_dir))
- (makedir cmpi_dir (infos))
- )
-
- ; Create IShapes drawer if it's not already there
- ;------------------------------------------------
- (if (not (exists ish_dir))
- (makedir ish_dir (infos))
- )
-
- ; make assignments so user can operate immediately
- ;-------------------------------------------------
- (makeassign "RXPI" rxpi_dir (safe))
- (makeassign "CMPI" cmpi_dir (safe))
-
- ; Check to see if user has old rxpi and cmpi installation
- ; If so, copy those files to the new location in case they
- ; have any aftermarket or custom PI modules in there...
- ;--------------------------------------------------------
- (if (exists "rexx:rxpi")
- (
- (set as_made 0) ; because we are in a new location!
- (copyfiles (source "rexx:rxpi") (dest "rxpi:")
- (pattern "#?") (files))
- (run "delete rexx:rxpi/#? QUIET")
- (run "delete rexx:rxpi QUIET")
- )
- )
-
- (if (exists "c:cmpi")
- (
- (set as_made 0) ; because we are in a new location!
- (copyfiles (source "c:cmpi") (dest "cmpi:")
- (pattern "#?") (files))
- (run "delete rexx:cmpi/#? QUIET")
- (run "delete rexx:cmpi QUIET")
- )
- )
-
- ; copy things we KNOW we need
- ;----------------------------
- (set imp_src src_two)
- (askdisk
- (prompt ("Please insert the %s diskette " imp_src))
- (help "This diskette is absolutely required to complete this "
- "installation!")
- (dest imp_src)
- )
- (copyfiles (source (cat imp_src ":"))
- (dest "ram:")
- (pattern "(ish.lzh|fv.lzh|imi.lzh)")
- (files)
- )
-
- ; Extract this portion of the installation
- ;-----------------------------------------
- (run ("ram:extract >con:0/50/640/100/extract -m e ram:imi %s/" im_dest))
- (run ("ram:extract >con:0/50/640/100/extract -m e ram:fv %s/" im_dest))
- (run ("ram:extract >con:0/50/640/100/extract -m e ram:ish %s/" ish_dir))
-
- ; Decide about .info file name
- ;-----------------------------
- (if (= float_install 0)
- (rename (tackon im_dest "iminfo") (tackon im_dest "imf.info")) ; then
- (rename (tackon im_dest "iminfo") (tackon im_dest "im.info")) ; else
- )
-
- ; Clean up after these archives
- ;------------------------------
- (delete "ram:ish.lzh")
- (delete "ram:fv.lzh")
- (delete "ram:imi.lzh")
-
- ; Now, we'll extract the main image processor after figuring out which ver
- ;-------------------------------------------------------------------------
- (set imp_src src_two)
- (set proc_file "ima.lzh")
- (if (= float_install 0)
- (
- (set imp_src src_one)
- (set proc_file "imb.lzh")
- )
- )
-
- ; Ask for the proper diskette
- ;----------------------------
- (askdisk
- (prompt ("Please insert the %s diskette " imp_src))
- (help "This diskette is absolutely required to complete this "
- "installation!")
- (dest imp_src)
- )
-
- ; This gets the needed archive from the proper disk
- ;--------------------------------------------------
- (copyfiles (source (cat imp_src ":"))
- (dest "ram:")
- (pattern proc_file)
- (files)
- )
-
- ; Here, we extract the image processor, copying it at the same time
- ;------------------------------------------------------------------
- (run ("ram:extract >con:0/50/640/100/extract -m e ram:%s %s/" proc_file im_dest))
-
- ; Delete the image processor archive
- ;-----------------------------------
- (delete ("ram:%s" proc_file))
-
- ; Now we'll go after the two optional installs and the PI modules
- ;----------------------------------------------------------------
- (set imp_src src_three)
- (askdisk
- (prompt ("Please insert the %s diskette " imp_src))
- (help "This diskette is absolutely required to complete this "
- "installation!")
- (dest imp_src)
- )
-
- ; If user wants the developer stuff, install it
- ;----------------------------------------------
- (if (= dev_install 1)
- (
- (if (not (exists dev_dir))
- (makedir dev_dir (infos))
- )
- (copyfiles (source (cat imp_src ":"))
- (dest "ram:")
- (pattern "dd.lzh")
- (files))
- (run ("ram:extract >con:0/50/640/100/extract -m e ram:dd %s/" dev_dir))
- (delete "ram:dd.lzh")
- )
- )
-
- ; Get the archive....
- ;----------------------------------------------------
- (makedir "ram:gbzyx")
- (copyfiles (source (cat imp_src ":"))
- (dest "ram:")
- (pattern "piarc.lzh")
- (files)
- )
-
- ; Install the dctv.library for reading and writing dctv pix
- ;----------------------------------------------------------
- (set imp_src src_four)
- (askdisk
- (prompt ("Please insert the %s diskette " imp_src))
- (help "This diskette is required to install "
- "dctv.library, and possibly the addendum "
- "documentation, if you asked for it on disk.")
- (dest imp_src)
- )
- (copyfiles (source (cat imp_src ":"))
- (dest "ram:")
- (pattern "dc.lzh")
- (files)
- )
- (run ("ram:extract >con:0/50/640/100/extract -m e ram:dc ram:"))
- (copylib (source "ram:dctv.library")
- (dest "libs:")
- )
- (delete "ram:dc.lzh")
- (delete "ram:dctv.library")
-
-
- ; If user wants the documents, install them
- ;------------------------------------------
- (if (= doc_install 1)
- (
- (if (not (exists doc_dir))
- (makedir doc_dir (infos))
- )
- (copyfiles (source (cat imp_src ":"))
- (dest "ram:")
- (pattern "ia.lzh")
- (files)
- )
- (run ("ram:extract >con:0/50/640/100/extract -m e ram:ia %s/" doc_dir))
- (delete "ram:ia.lzh")
- )
- )
-
- ; Now for the FUN part... get the PI modules installed
- ; Begin by backing up old macro file(s), if they exist
- ;-----------------------------------------------------
- (if (exists "s:Default.immcr.old")
- (delete "s:Default.immcr.old"))
- (if (exists "s:Default.immcr")
- (rename "s:Default.immcr" "s:Default.immcr.old"))
- ;---------------
- (if (exists "s:Default.iimcr.old")
- (delete "s:Default.iimcr.old"))
- (if (exists "s:Default.iimcr")
- (rename "s:Default.iimcr" "s:Default.iimcr.old"))
- ;---------------
- (if (exists "s:Default.ipmcr.old")
- (delete "s:Default.ipmcr.old"))
- (if (exists "s:Default.ipmcr")
- (rename "s:Default.ipmcr" "s:Default.ipmcr.old"))
- ;---------------
-
- ; Old macros are backed up, ready for main PI install
- ; Now really extract the stuff
- ;----------------------------------------------------
- (run ("ram:extract >con:0/50/640/100/extract -m e ram:piarc ram:gbzyx/"))
- (delete "ram:piarc.lzh")
-
- ; Archive is unpacked and ready to copy
- ; first, backup list.list if available
- ;--------------------------------------
- (if (exists "cmpi:list.list")
- (
- (if (exists "cmpi:list.list.old")
- (delete "cmpi:list.list.old")
- )
- (rename "cmpi:list.list" "cmpi:list.list.old")
- (message "Please note that during installation, your previous "
- "\"list.list\" file was located and renamed to "
- "\"list.list.old\". All of your aftermarket PI "
- "modules (if any) are still intact, but will not "
- "show up on PI lists untill the new list.list file "
- "has been appropriately modified."
- (help "This has been done so that you may refer to it if "
- "you had aftermarket PI modules declared in it. "
- "A new list.list file has been created as part of "
- "this install procedure - you should use this new "
- "list.list file instead of the old one (that will "
- "happen automatically) but if you DID have any "
- "aftermarket PI modules, such as Metadigm's ES300c "
- "scanner driver, you'll need to add the control "
- "line(s) for it (them) into the new list.list file. "
- "You would then use the old list.list file as a template "
- "to accomplish this.")
- )
- )
- )
-
- ; move the "odd" files (not PI rexx or PI cmds)
- ;----------------------------------------------
- (copyfiles (source "ram:gbzyx") (dest "rexx:")
- (pattern "(picmdpath|launch.rexx)") (files))
- (copyfiles (source "ram:gbzyx") (dest "s:")
- (pattern "(default.??mcr)") (files))
- (copyfiles (source "ram:gbzyx") (dest "cmpi:")
- (pattern "list.list") (files))
- (copyfiles (source "ram:gbzyx") (dest "rxpi:wipes")
- (pattern "#?.rxwp") (files))
- (delete "ram:gbzyx/picmdpath")
- (delete "ram:gbzyx/list.list")
- (delete "ram:gbzyx/launch.rexx")
- (run "delete ram:gbzyx/Default.??mcr QUIET")
- (run "delete ram:gbzyx/#?.rxwp QUIET")
-
- ; Next, copy all the PI ARexx scripts
- ;------------------------------------
- (copyfiles (source "ram:gbzyx") (dest "rxpi:")
- (pattern "#?.rexx") (files))
- (run "delete ram:gbzyx/#?.rexx QUIET")
-
- ; Next, copy all the PI Commands
- ;-------------------------------
- (copyfiles (source "ram:gbzyx") (dest "cmpi:")
- (pattern "#?") (files))
-
- ; Now, we have to decide if we can install the FPU PI modules
- ;------------------------------------------------------------
- (if (exists "CMPI:rdjpg") (delete "CMPI:rdjpg"))
- (if (exists "CMPI:wrjpg") (delete "CMPI:wrjpg"))
- (if (= float_install 0)
- ((rename "CMPI:x_JPR030" "CMPI:rdjpg") ; then
- (rename "CMPI:x_JPW030" "CMPI:wrjpg"))
- ((rename "CMPI:x_JPR000" "CMPI:rdjpg") ; else
- (rename "CMPI:x_JPW000" "CMPI:wrjpg"))
- )
-
- ; clean up
- ;---------
- (run "delete CMPI:x_#? QUIET")
- (run "delete ram:gbzyx/#? QUIET")
- (delete "ram:gbzyx")
- (delete "ram:extract")
-
- ; Add assignment to user's "user-startup" directory for new boot ops
- ; IF they were not already correctly done
- ;-------------------------------------------------------------------
- (if (= as_made 0)
- (startup "Imagemaster"
- (help "This operation adds lines to your user-startup file "
- "which are harmless assignment statements to drawers "
- "within the Imagemaster drawer, called \"RXPI:\" and "
- "\"CMPI:\" each time you boot your Amiga. These assignments "
- "are used to let Imagemasters Public Interface (PI) drivers know "
- "where its data files reside. Unless you know that you have "
- "another assignment with one of these names, it is extremely "
- "unlikely that there would be any reason to NOT let this happen. "
- "Note that if this is a reinstall, but it is the first time "
- "you have installed using this installation procedure, you "
- "SHOULD allow these assigns to be made, even if you had "
- "assigns to RXPI and CMPI you created yourself. The PI "
- "modules are now kept in a different location, so these new "
- "assignments are necessary.")
- (prompt "Is it o.k. to add two SAFE lines to your User-Startup "
- "file?")
- (command ("assign RXPI: %s\n" rxpi_dir))
- (command ("assign CMPI: %s" cmpi_dir))
- )
- )
-
- (exit)
-